package com.coderitl.springmvc.service.impl;

import com.coderitl.springmvc.dao.BookInfoDao;
import com.coderitl.springmvc.service.BookInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookInfoServiceImpl implements BookInfoService {
    /**
     * dao 是引用类型,BookInfoDao 类型的对象是 spring 的配置文件中创建的对象
     * 引用类型自动注入: @Autowired | @Resource
     */
    @Autowired
    private BookInfoDao bookInfoDao;

    @Override
    public List<BookInfoDao> showAllBook() {
        List<BookInfoDao> bookInfos = bookInfoDao.selectShowAllBookInfo();
        if (bookInfos != null) {
            return bookInfos;
        }
        return null;
    }
}
